<template>
  <div>
    <el-dialog
      center
      title="添加商品"
      v-model="dialogVisible"
      width="50%"
      size="mini"
      destroy-on-close
      :close-on-click-modal="false"
      :close-on-press-escape="false"
    >
      <el-table :data="tableData" style="width: 100%">
        <el-table-column type="selection" width="55"> </el-table-column>
        <el-table-column label="图片" width="120">
          <template #default="scope">{{ scope.row.Name }}</template>
        </el-table-column>
        <el-table-column label="商品名称" width="120">
          <template #default="scope">{{ scope.row.Name }}</template>
        </el-table-column>
        <el-table-column label="价格" width="120">
          <template #default="scope">{{ scope.row.Price }}</template>
        </el-table-column>
      </el-table>
    </el-dialog>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'

export default defineComponent({
  tableData: {
    type: Array,
    default: () => [],
  },
  setup() {
    const dialogVisible = ref(true)

    return { dialogVisible }
  },
})
</script>

<style scoped></style>
